package com.yx.doodleview.ui.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yx.doodleview.R;
import com.yx.doodleview.bean.ColorBean;

import java.util.List;

/**
 * Created by yx on 2017/8/18.
 */

public class SelectAdapter extends BaseQuickAdapter<ColorBean, BaseViewHolder> {
    public SelectAdapter(@Nullable List<ColorBean> data) {
        super(R.layout.ui_select_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ColorBean item) {
        if (item.isCheck()){
            helper.setBackgroundRes(R.id.iv_choose,R.drawable.vector_drawable_ic_check_selected);
        }else {
            helper.setBackgroundRes(R.id.iv_choose,R.drawable.vector_drawable_ic_check_normal);
        }
        helper.setText(R.id.tv_text, item.getText());
    }
}
